/**
 * 2009-10-26 下午05:12:07 
 * esignature
 * com.smc.server.impl
 * UserServiceImpl
 */
package com.smc.server.impl;

import java.util.List;

import com.smc.dao.HospitalDao;
import com.smc.dao.UserDao;
import com.smc.domain.model.Authentication;
import com.smc.domain.model.Hospital;
import com.smc.domain.model.User;
import com.smc.server.UserService;

/**
 * @author chenheng
 * @version 0.0.1
 * 用户服务接口实现
 */
public class UserServiceImpl implements UserService {
	
	private UserDao userDao ;
	private HospitalDao hospitalDao ;
	public String sysPath ;
	public String headerIconPath ;
	public String cert2Path ;
	
	public void setCert2Path(String cert2Path) {
		this.cert2Path = cert2Path;
	}

	public void setHeaderIconPath(String headerIconPath) {
		this.headerIconPath = headerIconPath;
	}

	public void setSysPath(String sysPath) {
		this.sysPath = sysPath;
	}

	public HospitalDao getHospitalDao() {
		return hospitalDao;
	}

	public void setHospitalDao(HospitalDao hospitalDao) {
		this.hospitalDao = hospitalDao;
	}

	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	
	public List<Authentication> fetch_IG_IG_IG_authentication(User user) {
	
		return null;
	}

	public User login_IG_IG_IG_user(String username, String password) {
		User user = userDao.login_IG_IG_IG_user(username, password);
		return user;
	}

	public void save_HO_US_SA_user(User user) {
		userDao.save_HO_US_SA_user(user);
	}

	public List<User> fetch_OP_US_FE_user(String hospitalUuid) {
		return userDao.fetch_OP_US_FE_user(hospitalUuid);
	}

	public List<Hospital> fetch_IG_IG_IG_hospital() {
		return hospitalDao.fetchAllHospital();
	}

	public void save_IG_IG_IG_user(User user) {
		userDao.saveUser(user);
	}

	public String get_IG_IG_IG_Cert2Path() {
		return sysPath + cert2Path;
	}

	public String get_IG_IG_IG_HeaderIconPath() {
		return sysPath + headerIconPath;
	}

	public List<User> fetch_AD_US_FE_user(boolean verified, int pageIndex, int pageSize) {
		return userDao.fetchVerifiedUser(verified, pageIndex, pageSize);
	}

	public int coutn_AD_US_FE_user(boolean verified) {
		return userDao.countVerifiedUser(verified);
	}

	public int count_AD_US_FE_user(boolean verified) {
		return userDao.countVerifiedUser(verified);
	}

	public int count_AD_US_FE_user() {
		return userDao.countUser();
	}

	public List<User> fetch_AD_US_FE_user(int pageIndex, int pageSize) {
		return userDao.fetchUser(pageIndex, pageSize);
	}

	public int count_AD_US_FE_user(String firstName, String lastName) {
		return userDao.countSearchUser(firstName, lastName);
	}

	public List<User> fetch_AD_US_FE_user(String firstName, String lastName, int pageIndex, int pageSize) {
		return userDao.searchUser(firstName, lastName, pageIndex, pageSize);
	}

	public User fetch_AD_US_FE_user(String uuid) {
		return userDao.searchUserByUuid(uuid);
	}

	public void save_AD_AU_SA_authentication(User user, int[] authes) {
		userDao.saveAuthentication(user, authes);
	}

	public void save_IG_US_SA_user(String uuid, String fileName) {
		userDao.updateUser(uuid, fileName);
	}

	public User fetch_IG_IG_IG_user(String username) {		
		return userDao.fetchUserByUsername(username);
	}

	public void remove_AD_US_RE_user(String uuid) {
		userDao.removeUser(uuid);
	}

	public User fetch_IG_IG_FE_user(String uuid) {
		return userDao.searchUserByUuid(uuid);
	}

	public void update_IG_IG_SA_user(User user) {
		userDao.updateUser(user);
	}

}
